package com.ws.universal.tools.eventbus;

import org.greenrobot.eventbus.EventBus;

/**
 * @创建者 ws
 * @创建时间 2021/9/27
 * @描述
 */
public class EventBusUtil {
    public static void resgisterEventBus(Object object) {
        if (!EventBus.getDefault().isRegistered(object)) {
            EventBus.getDefault().register(object);
        }
    }

    public static void unResgisterEventBus(Object object) {
        if (EventBus.getDefault().isRegistered(object)) {
            EventBus.getDefault().unregister(object);

        }
    }


    public static void postEvent(Object event) {
        EventBus.getDefault().post(event);
    }

    public static void postEvent(int event) {
        EventBus.getDefault().post(event);
    }
}
